package Learner;

import java.io.PrintWriter;
import java.util.ArrayList;

import ElementPackage.ConstForSVM;
import ElementPackage.DataVector;
import ElementPackage.Hyperplane;
import ElementPackage.Pattern;

public class SVMLearner {
	private ArrayList<DataVector> data;
	private OptimizeFramework optimizer;
	
	
	public SVMLearner()	{
		data = new ArrayList();
		optimizer = new Optimizer01();
	}
	public void setHyperplane()	{
		
	}
	//bad Design....T.T
	public Hyperplane Optimize(Pattern pattern)	{
		optimizer = new Optimizer01();
		optimizer.setVectorList(data);
		return getOptimizer().optimize(pattern);
	}
	
	public void setOptiRmizerVector() {
		
	}

	public void addData(DataVector parameter)	{
		data.add(parameter);
	}
	
	public void setOptiRmizer(OptimizeFramework optimizer) {
		this.optimizer = optimizer;
	}
	public OptimizeFramework getOptimizer() {
		return optimizer;
	}
	public void print(PrintWriter print_writer) {
		
		
		print_writer.println("SupportVector :");
		
		optimizer.getSupportVectorList().get(0).print(print_writer);
		optimizer.getSupportVectorList().get(1).print(print_writer);
	}
}
